const app = getApp();
const Controller = require('../controllers/controllers.js').controller;
Page({
  data: {
    title:'外链指定页',
    url:''
  },
  onLoad(option) {
    if(option){
      this.setData({
        url:option.url
      })
    }
    if(option.shareuserid){
      this.setData({
        shareuserid:option.shareuserid
      })
      this.uploadClickLog()
    }
  },
  uploadClickLog(){
    if(wx.getStorageSync('userInfo') && wx.getStorageSync('userInfo').id && this.data.shareuserid){
      Controller.uploadClickLog({
        userId:wx.getStorageSync('userInfo').id || '',
        byUserId:this.data.shareuserid,
        pages:"/pages/weixinlink/weixinlink?url="+this.data.url
      }).then(res=>{
        
      })
    }
  },
})